import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/couser_center/education_comment_list_entity.dart';

EducationCommentListEntity $EducationCommentListEntityFromJson(Map<String, dynamic> json) {
  final EducationCommentListEntity educationCommentListEntity = EducationCommentListEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    educationCommentListEntity.id = id;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    educationCommentListEntity.companyCode = companyCode;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    educationCommentListEntity.textbookId = textbookId;
  }
  final String? commentContent = jsonConvert.convert<String>(json['commentContent']);
  if (commentContent != null) {
    educationCommentListEntity.commentContent = commentContent;
  }
  final String? commentUserId = jsonConvert.convert<String>(json['commentUserId']);
  if (commentUserId != null) {
    educationCommentListEntity.commentUserId = commentUserId;
  }
  final String? commentUserName = jsonConvert.convert<String>(json['commentUserName']);
  if (commentUserName != null) {
    educationCommentListEntity.commentUserName = commentUserName;
  }
  final String? commentPid = jsonConvert.convert<String>(json['commentPid']);
  if (commentPid != null) {
    educationCommentListEntity.commentPid = commentPid;
  }
  final int? commentType = jsonConvert.convert<int>(json['commentType']);
  if (commentType != null) {
    educationCommentListEntity.commentType = commentType;
  }
  final int? commentScore = jsonConvert.convert<int>(json['commentScore']);
  if (commentScore != null) {
    educationCommentListEntity.commentScore = commentScore;
  }
  final int? commentLike = jsonConvert.convert<int>(json['commentLike']);
  if (commentLike != null) {
    educationCommentListEntity.commentLike = commentLike;
  }
  final int? commentCount = jsonConvert.convert<int>(json['commentCount']);
  if (commentCount != null) {
    educationCommentListEntity.commentCount = commentCount;
  }
  final int? commentSee = jsonConvert.convert<int>(json['commentSee']);
  if (commentSee != null) {
    educationCommentListEntity.commentSee = commentSee;
  }
  final String? commentPath = jsonConvert.convert<String>(json['commentPath']);
  if (commentPath != null) {
    educationCommentListEntity.commentPath = commentPath;
  }
  final dynamic isLike = json['isLike'];
  if (isLike != null) {
    educationCommentListEntity.isLike = isLike;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    educationCommentListEntity.createBy = createBy;
  }
  final dynamic createById = json['createById'];
  if (createById != null) {
    educationCommentListEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    educationCommentListEntity.createDate = createDate;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    educationCommentListEntity.updateBy = updateBy;
  }
  final dynamic updateById = json['updateById'];
  if (updateById != null) {
    educationCommentListEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    educationCommentListEntity.updateDate = updateDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    educationCommentListEntity.deleted = deleted;
  }
  final List<dynamic>? children = (json['children'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (children != null) {
    educationCommentListEntity.children = children;
  }
  return educationCommentListEntity;
}

Map<String, dynamic> $EducationCommentListEntityToJson(EducationCommentListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyCode'] = entity.companyCode;
  data['textbookId'] = entity.textbookId;
  data['commentContent'] = entity.commentContent;
  data['commentUserId'] = entity.commentUserId;
  data['commentUserName'] = entity.commentUserName;
  data['commentPid'] = entity.commentPid;
  data['commentType'] = entity.commentType;
  data['commentScore'] = entity.commentScore;
  data['commentLike'] = entity.commentLike;
  data['commentCount'] = entity.commentCount;
  data['commentSee'] = entity.commentSee;
  data['commentPath'] = entity.commentPath;
  data['isLike'] = entity.isLike;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['deleted'] = entity.deleted;
  data['children'] = entity.children;
  return data;
}

extension EducationCommentListEntityExtension on EducationCommentListEntity {
  EducationCommentListEntity copyWith({
    String? id,
    String? companyCode,
    String? textbookId,
    String? commentContent,
    String? commentUserId,
    String? commentUserName,
    String? commentPid,
    int? commentType,
    int? commentScore,
    int? commentLike,
    int? commentCount,
    int? commentSee,
    String? commentPath,
    dynamic isLike,
    String? createBy,
    dynamic createById,
    String? createDate,
    String? updateBy,
    dynamic updateById,
    String? updateDate,
    String? deleted,
    List<dynamic>? children,
  }) {
    return EducationCommentListEntity()
      ..id = id ?? this.id
      ..companyCode = companyCode ?? this.companyCode
      ..textbookId = textbookId ?? this.textbookId
      ..commentContent = commentContent ?? this.commentContent
      ..commentUserId = commentUserId ?? this.commentUserId
      ..commentUserName = commentUserName ?? this.commentUserName
      ..commentPid = commentPid ?? this.commentPid
      ..commentType = commentType ?? this.commentType
      ..commentScore = commentScore ?? this.commentScore
      ..commentLike = commentLike ?? this.commentLike
      ..commentCount = commentCount ?? this.commentCount
      ..commentSee = commentSee ?? this.commentSee
      ..commentPath = commentPath ?? this.commentPath
      ..isLike = isLike ?? this.isLike
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..deleted = deleted ?? this.deleted
      ..children = children ?? this.children;
  }
}
